package com.atguigu.esdemo.entity;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.JSONPObject;
import lombok.Data;

import java.util.Map;

/**
 * @author fenge
 */
@Data
public class House {
    private String address;
    private String id;
    private User user;

    public void setUser(Map<String, Object> map){

        ObjectMapper mapper = new ObjectMapper();
        this.user = mapper.convertValue(map, User.class);
    }

    /*
    public void setBookingRule(String bookingRule) {
		this.bookingRule = JSONObject.parseObject(bookingRule, BookingRule.class);
	}
     */

}
